
Ext.Loader.setPath({
    'Ext': 'sdk/src'
});

if(Ext.os.is('Desktop') || Ext.os.is('Tablet')) {
     varfontSize = '12px';
     vardefaultUI = 'normal';
     varbuttonWidth = 100;
} else {
     varfontSize = '16px';
     vardefaultUI = 'large';
     varbuttonWidth = 200;
}

Ext.application({
    controllers: ['Main'],
    
    name: 'testleo',

    requires: [
        'Ext.MessageBox'
    ],

    views: ['Main', 'News', 'News-dark', 'Home', 'Contact', 'Blog' ],

    icon: {
        57: 'resources/icons/Icon-AIFMD.png',
        72: 'resources/icons/Icon~ipad-AIFMD.png',
        114: 'resources/icons/Icon@2x.png',
        144: 'resources/icons/Icon~ipad@2x.png'
    },
    
    phoneStartupScreen: 'resources/loading/Homescreen-cs.png',
    tabletStartupScreen: 'resources/loading/Homescreen~ipad-cs.png',

    launch: function() {
        // Destroy the #appLoadingIndicator element
        Ext.fly('appLoadingIndicator').destroy();

        // Initialize the main view
        Ext.Viewport.add(Ext.create('testleo.view.Main', {fullscreen: true}));
    },

    onUpdated: function() {
        Ext.Msg.confirm(
            "Application Update",
            "This application has just successfully been updated to the latest version. Reload now?",
            function() {
                window.location.reload();
            }
        );
    }
});
